<script setup>
import { reactive, ref } from "vue"
import { routes } from "./router"
const menus = reactive(routes.filter((m) => !m.meta?.hide))
const activeIndex = ref('1')
</script>

<template>
  <div id="root">
    <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" background-color="#000" text-color="#fff" active-text-color="#ffd04b">
      <el-menu-item v-for="(menu, i) in menus" :key="menu.name" :index="i + ''">
        <RouterLink :to="menu.path">{{menu.name}}</RouterLink>
      </el-menu-item>
    </el-menu>

    <RouterView style="padding: 20px;" v-slot="{Component}">
      <KeepAlive>
        <component :is="Component" />
      </KeepAlive>
    </RouterView>

  </div>
</template>

<style>
body {
  margin: 0;
  background: #222;
}
input {
  outline: none;
  background: #444;
  color: #fff;
  padding: 10px;
}
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #fff;
}
#root {
  /* margin: 0 20px; */
}
.theme-dark {
  color: #fff;
}
.hcenter {
  text-align: center;
}
.flex-row {
  display: flex;
  flex-direction: row;
}
.full-w {
  width: 100%;
}
.full-h {
  height: 100%;
}
.full-size {
  width: 100%;
  height: 100%;
}
.ml20 {
  margin-left: 20px !important;
}
.mt20 {
  margin-top: 20px !important;
}
.el-menu--horizontal {
  border-bottom: none !important;
}
.el-form-item__label {
  color: #fff !important;
}
</style>
